<template>
	<view class="list-view">
		<view class="top-bar"><uni-navbar :fixed="true" :back="true" color="#fff" title="确认记录"></uni-navbar></view>

		<view class="info-box" v-if="id">
			<view class="info-title">
				{{ name }}
				<text class="dept">{{ dept }}</text>
			</view>
		</view>

		<view class="container">
			<view class="sign-box">
				<view class="pro-row" v-for="(item, index) in signList" :key="item.id">
					<view class="pro-title">{{ item.userId }}</view>
					<view class="pro-block flex">
						<view class="pro-left">小组名称:</view>
						<view class="pro-right">{{ item.remark4 }}</view>
					</view>
					<view class="pro-block flex">
						<view class="pro-left">报名时间:</view>
						<view class="pro-right">{{ item.remark5 }}</view>
					</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
import { mapState } from 'vuex';
export default {
	data() {
		return {
			id: '',
			signList: '',
			dept: '',
			name: ''
		};
	},
	onLoad(option) {
		this.loadLogin();
		this.id = option.id;
		this.name = decodeURI(option.name);
		this.dept = decodeURI(option.dept);
		this.loadData();
	},
	computed: {
		...mapState(['userInfo'])
	},
	methods: {
		loadLogin() {
			if (this.userInfo.Authorization) {
				this.clientCode = this.userInfo.sysUser.clientCode;
				this.userId = this.userInfo.sysUser.id;
				this.roleCodes = this.userInfo.roleCodes.join(',');
			} else {
				this.$logout();
			}
		},
		loadData() {
			let data = {
				pageNum: 1,
				pageSize: 9999,
				type: 'baoming',
				meetingId: this.id,
				roleCodes: this.roleCodes,
				curUserId: this.userId,
				clientCode: this.clientCode
			};
			this.$request('/huiyihuodong/hyhd-meeting-user/meetingRecords', data).then((res) => {
				this.signList = res.data.records;
			});
		}
	}
};
</script>

<style lang="scss">
.info-box {
	padding: 30rpx 30rpx;

	.info-title {
		margin-bottom: 14rpx;
	}
}
.pro-title {
	margin-bottom: 4px;
}
.sign-box {
	margin-top: 30rpx;
}
</style>
